<script>
	export default {
		onLaunch: function() {
			console.log('onLaunch');
			this.$api.check_token().then(res=>{
				const {uid,userInfo} = res
				let page = getCurrentPages()
				let route = page[0].route
				if(route === 'pages/home/home'){
					uni.reLaunch({
					    url: '/pages/index/index',
					});
				}
			}).catch(err=>{
				console.log(err);
				uni.navigateTo({
				    url: '/pages/home/home'
				});
				uni.removeStorageSync('uni_id_token')
				uni.removeStorageSync('uni_id_token_expired')
			})
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	@import '@/uni_modules/uni-ui-scss';
	/*每个页面公共css */
	uni-main {
		box-sizing: border-box;
		overflow: hidden;
	}
</style>
